package com.zhuss.bean.bo.team.information;

import com.zhuss.common.BaseBo;
import com.zhuss.common.IdBo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author: zhushanshuo
 * @Date: 2020/3/3 14:42
 */
public class CreateInfoBo extends IdBo implements Serializable, BaseBo {

    /**
	 * 
	 */
	private static final long serialVersionUID = -705229236904801579L;

    private Integer sendType;

	private Long type;

    private String infoKey;

    private List<List<Long>> companyId;

    private List<Long> companyIdList;

    private List<Long> userIdList;

    private String person;

    private String title;

    private Integer visible;

    private Integer area;

    private String content;

    private String format;

    public Integer getSendType() {
        return sendType;
    }

    public void setSendType(Integer sendType) {
        this.sendType = sendType;
    }

    public Long getType() {
        return type;
    }

    public void setType(Long type) {
        this.type = type;
    }

    public String getInfoKey() {
        return infoKey;
    }

    public void setInfoKey(String infoKey) {
        this.infoKey = infoKey;
    }

    public String getCompanyId() {
        StringBuffer sb = new StringBuffer();
        companyIdList = new ArrayList<>();
        userIdList = new ArrayList<>();
        for (List<Long> item : companyId) {
            companyIdList.add(item.get(0));
            if (item.size() < 2){
                continue;
            }else {
                userIdList.add(item.get(1));
            }
        }
        if (companyIdList != null && companyIdList.size() > 0) {
            for (Long item : companyIdList) {
                sb.append(item);
                sb.append(",");
            }
            sb.deleteCharAt(sb.lastIndexOf(","));
        }
        return sb.toString();
    }

    public void setCompanyId(List<List<Long>> companyId) {
        this.companyId = companyId;
    }

    public String getPerson() {
        StringBuffer sb = new StringBuffer();
        if (userIdList != null && userIdList.size() > 0) {
            for (Long item : userIdList) {
                sb.append(item);
                sb.append(",");
            }
            sb.deleteCharAt(sb.lastIndexOf(","));
        }
        return sb.toString();
    }

    public void setPerson(String person) {
        this.person = person;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getVisible() {
        return visible;
    }

    public void setVisible(Integer visible) {
        this.visible = visible;
    }

    public Integer getArea() {
        area = getConcurrentArea();
        return area;
    }

    public void setArea(Integer area) {
        this.area = area;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getFormat() {
        return format;
    }

    public void setFormat(String format) {
        this.format = format;
    }
}
